import request from "@/utils/request2";

export function InsertEquipment(map) {
  return request({
    url: "/maintenance/InsertEquipment",
    method: "post",
    data: JSON.stringify(map),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

export function InsertAnnex(an) {
  return request({
    url: "/maintenance/InsertAnnex",
    method: "post",
    data: an,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

//查询设备档案
export function listEquipment(eq, pageNum, pageSize) {
  return request({
    url:
      "/maintenance/SelectEquipment?pageNum=" +
      pageNum +
      "&pageSize=" +
      pageSize,
    method: "get",
    params: eq,
  });
}

//查询设备附件
export function listAnnex(code) {
  return request({
    url: "/maintenance/SelectAnnex",
    method: "get",
    params: code,
  });
}

//查询设备图片
export function listImg(code) {
  return request({
    url: "/maintenance/SelectImg?code=" + code,
    method: "get",
  });
}

//查询设备文档
export function SelectDocumentaion(code) {
  return request({
    url: "/maintenance/SelectDocumentaion?code=" + code,
    method: "get",
  });
}

//查询子设备
export function SelectSubbDevices(code) {
  return request({
    url: "/maintenance/SelectSubbDevices?code=" + code,
    method: "get",
  });
}

export function listEquipment2(pageNum, pageSize) {
  return request({
    url:
      "/maintenance/SelectEquipment?pageNum=" +
      pageNum +
      "&pageSize=" +
      pageSize,
    method: "get",
  });
}

export function InsertSbdeice(subDevices) {
  return request({
    url: "/maintenance/InsertSubDevices",
    method: "post",
    data: subDevices,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}
